﻿Public Structure Pair(Of T1, T2)
    Public ReadOnly First As T1
    Public ReadOnly Second As T2

    Public Sub New(ByVal first As T1, ByVal second As T2)
        Me.First = first
        Me.Second = second
    End Sub

End Structure

Public Module Utilities

    Public Function Distance(ByVal a As Point, ByVal b As Point) As Double
        Return Math.Sqrt((a.X - b.X) ^ 2 + (a.Y - b.Y) ^ 2)
    End Function

    Public Function Distance(ByVal p As Pair(Of Point, Point)) As Double
        Return Distance(p.First, p.Second)
    End Function

End Module